# Tool binds
bindk(key.paragraph, toggle_selection_type)
bindc('1', tool_pen )
bindc('2', tool_brush )
bindc('3', tool_picker )
bindc('4', tool_line )
bindc('5', tool_spline )
bindc('6', tool_rectangle)
bindc('7', tool_ellipse )
bindc('8', tool_polygon )
bindc('9', tool_text )
bindc('0', tool_fill )

# Layer choice
bindc('q', raster_layer )
bindc('w', object_layer )

# Convenient zoom
bindc('a', zoom_in )
bindc('z', zoom_out )

# Misc
bindk(key.space, select_top_object)
bindc( 's', swap_colors)
bindc( 'c', center_on_cursor )
bindc( 'c', center_on_selected, mod.alt )
bindc( 'x', pick_color_fg )
bindc( 'i', context_flip_horizontal )
bindc( 'j', context_flip_vertical )
bindc( 'k', context_rotate_90CW )

def explorer_active_file():
    import subprocess
    filename = get_active_image().get_filename()
    if filename is not None:
        subprocess.Popen(r'explorer /select,"%s"' % get_active_image().get_filename())
bindc('e', explorer_active_file )
